package com.sysu.minsysu.utils;

import com.sysu.minsysu.R;

import android.content.Context;
import android.graphics.Color;
import android.view.Gravity;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

public class TabWidgetView extends LinearLayout{


	public TabWidgetView(Context context, int bitmapId, String text ) {
		super(context);
		setOrientation(LinearLayout.VERTICAL);
		setBackgroundResource(R.drawable.kuang);
		ImageView imageView = new ImageView(context);
		LayoutParams layoutParams = new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT);
		imageView.setAdjustViewBounds(true);
		imageView.setLayoutParams(layoutParams);		
		imageView.setImageResource( bitmapId );

		TextView textView = new TextView(context);
		textView.setLayoutParams(layoutParams);
		textView.setText(text);
		textView.setGravity(Gravity.CENTER);
		textView.setHighlightColor(Color.WHITE);
		textView.setTextColor(Color.WHITE);
		
		addView(imageView);
		addView(textView);
	}

}
